package com.example.software.controller;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

// import org.apache.shiro.authz.annotation.RequiresPermissions;
import com.example.software.entity.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.example.software.entity.IntegrityEntity;
import com.example.software.service.IntegrityService;
import com.example.software.utils.PageUtils;
import com.example.software.utils.R;



/**
 * 
 *
 * @author wxy
 * @email wxy9496099@163.com
 * @date 2024-10-28 10:54:37
 */
@RestController
@Slf4j
@Api(tags = "病人用户挂号信誉相关接口")
@RequestMapping("software/integrity")
public class IntegrityController {
    @Autowired
    private IntegrityService integrityService;

    /**
     * 列表
     */
    @GetMapping("/list")
    @ApiOperation(value = "病人用户挂号信誉列表查询")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "page", value = "页数", required = true),
            @ApiImplicitParam(name = "size", value = "每页数量",dataType = "int"),
    })
   // @RequiresPermissions("software:integrity:list")
    public Result<PageUtils> list(@RequestParam String page,
                                  @RequestParam String size){


        Map<String, Object> params = new HashMap<>();
        params.put("page",page);
        params.put("limit",size);

        PageUtils page2 = integrityService.queryPage(params);

        return Result.success(page2);
    }


    /**
     * 信息
     */
    @GetMapping("/info/{id}")
    @ApiOperation(value = "根据id查询病人用户挂号信誉信息")
    // @RequiresPermissions("software:integrity:info")
    public Result<IntegrityEntity> info(@PathVariable("id") Integer id){
		IntegrityEntity integrity = integrityService.getById(id);

        return Result.success(integrity);
    }

    /**
     * 保存
     */
//    @PostMapping
//    @ApiOperation(value = "新增病人用户挂号信誉")
//    // @RequiresPermissions("software:integrity:save")
//    public R save(@RequestBody IntegrityEntity integrity){
//		integrityService.save(integrity);
//
//        return R.ok();
//    }

//    /**
//     * 修改
//     */
//    @RequestMapping("/update")
//
//    // @RequiresPermissions("software:integrity:update")
//    public R update(@RequestBody IntegrityEntity integrity){
//		integrityService.updateById(integrity);
//
//        return R.ok();
//    }
//
//    /**
//     * 删除
//     */
//    @RequestMapping("/delete")
//    // @RequiresPermissions("software:integrity:delete")
//    public R delete(@RequestBody Integer[] ids){
//		integrityService.removeByIds(Arrays.asList(ids));
//
//        return R.ok();
//    }

}
